<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<a id="show">距离2022年9月1日还有：<span></span>天<span></span>小时<span></span>分<span></span>秒</a>
		<script type="text/javascript">
			// 2.计算现在到明年09-01的时间差, 然后开始倒计时,并输出在页面上, 输出格式: x天x小时x分钟x秒。
			
			//时差30天
			var show = document.getElementById("show").getElementsByTagName("span");
			setInterval(function() {
				let targetTimezone = -9;
				var now = new Date();
				var time = new Date(2022, 9, 1, 0, 0, 0);
				var num = time.getTime() - now.getTime();
				var day = parseInt(num / (24 * 60 * 60 * 1000));
				num = num % (24 * 60 * 60 * 1000);
				var hour = parseInt(num / (60 * 60 * 1000));
				num = num % (60 * 60 * 1000);
				var minute = parseInt(num / (60 * 1000));
				num = num % (60 * 1000);
				var seconde = parseInt(num / 1000);
				show[0].innerHTML = day;
				show[1].innerHTML = hour;
				show[2].innerHTML = minute;
				show[3].innerHTML = seconde;
			}, 100)
		</script>
	</body>
</html>
